<html>
<head>
    <script src="js/jquery.min.js"></script>
    <script type="text/javascript">
        function timedMsg()
        {
            if($("#t").val()<'0'){
                console.log("不能为负");
            }
            //var t=setTimeout("alert('5 seconds!')",5000);
        }
    </script>
</head>

<body>
    <form>
        <input type="number" id="t">
        <input type="button" value="Display timed alertbox!"
        onClick="timedMsg()">
    </form>
    <p>Click on the button above. An alert box will be
    displayed after 5 seconds.</p>
</body>

</html>